package org.hibernate.tutorial.util;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	
	private static SessionFactory sessionFactory = null;
	
	private HibernateUtil() {
		
	}
	
	@SuppressWarnings("deprecation")
	public static synchronized SessionFactory getSessionFactory() {
			if (null == sessionFactory) {
				sessionFactory = new Configuration().configure().buildSessionFactory();
			}
		return sessionFactory;
	}

}
